]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Don't animate notifications if they've shrunk.
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 23 May 2011 21:15:08 +0000 (17:15 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 3 Jun 2011 17:37:53 +0000 (13:37 -0400)
The effect of the large gap breaks the illusion of the message attached to
the bottom of the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=641570

js/ui/messageTray.js

index 8c7dbf8187e3b9989f701af70d578df65abe86a3..5c57c9c2e08687b8155c8133802d6d8b39f481a5 100644 (file)
@@ -2011,9 +2011,15 @@ MessageTray.prototype = {
         this._notification.expand(!autoExpanding);
     },
 
-   _onNotificationExpanded: function() {
+    _onNotificationExpanded: function() {
         let expandedY = this.actor.height - this._notificationBin.height;
-        if (this._notificationBin.y != expandedY)
+
+        // Don't animate the notification to its new position if it has shrunk:
+        // there will be a very visible "gap" that breaks the illusion.
+
+        if (this._notificationBin.y < expandedY)
+            this._notificationBin.y = expandedY;
+        else if (this._notification.y != expandedY)
             this._tween(this._notificationBin, '_notificationState', State.SHOWN,
                         { y: expandedY,
                           time: ANIMATION_TIME,